<script>
    $("#edit_company").validate({
            
        submitHandler: function(form) {
            $(form).ajaxSubmit({
                target: "#content",
                beforeSubmit:function(){
                    $(".submit_button").hide();
                            
                }
                    
            }
       
        );
                
                
        }
           
    });
    $(".calendario").datepicker({
        yearRange: '1900:2050',
        dateFormat: 'yy-mm-dd',
        showOn: 'both',
        buttonImage: './img/calendar.jpg',
        buttonImageOnly: true,
        changeYear: true,
        numberOfMonths: 1

    });
</script>



<h1></h1>

<?php echo $this->Form->create("Company", array("id" => "edit_company", "action" => "edit/" . $this->data['Company']['id'])); ?>

</table><table border="0" width="4">

    <tbody>
        <tr>
            <td colspan="4"><?php echo $this->Form->input('Company.razon_social', array('class' => 'required')); ?></td>

        </tr>
        <tr>
            <td colspan="2"><?php echo $this->Form->input('Company.representante_legal'); ?></td>
            <td>
                <?php echo $this->Form->input('Company.id'); ?>
                <?php echo $this->Form->input('Company.cedula_representante_legal'); ?>
            </td>
            <td><?php echo $this->Form->input('Company.telefono_representante_legal'); ?></td>
        </tr>
        <tr>
            <td><?php echo $this->Form->input('Company.nit'); ?></td>
            <td><?php echo $this->Form->input('Company.personeria_juridica'); ?></td>
            <td><?php echo $this->Form->input('Company.fecha_personeria_juridica', array('class' => 'calendario', 'type' => 'text')); ?></td>
            <td><?php echo $this->Form->input('Company.fecha_constitucion', array('class' => 'calendario', 'type' => 'text')); ?></td>

        </tr>
        <tr>
            <td colspan="4"><?php echo $this->Form->input('Company.objeto_social'); ?></td>

        </tr>
        <tr>
            <td colspan="2"><?php echo $this->Form->input('Company.direccion'); ?></td>
            <td colspan="2"><?php echo $this->Form->input('Company.telefonos'); ?></td>


        </tr>

        <tr>
            <td colspan="2"><?php echo $this->Form->input('Company.nombre_del_encuestado'); ?></td>
            <td colspan="2"><?php echo $this->Form->input('Company.numero_inicial_hombres',array('label'=>'Número inicial hombres (Socios)')); ?></td>
        </tr>
        <tr>
            <td colspan="2"><?php echo $this->Form->input('Company.cargo_del_encuestado'); ?></td>
            <td colspan="2"><?php echo $this->Form->input('Company.numero_actual_hombres',array('label'=>'Número actual de hombres (Socios)')); ?></td>

        </tr>
        <tr>
            <td colspan="2"><?php echo $this->Form->input('Company.numero_inicial_mujeres',array('label'=>'Número inicial de mujeres (Socios)')); ?></td>
            <td colspan="2"><?php echo $this->Form->input('Company.numero_actual_mujeres',array('label'=>'Número actual de mujeres (Socios)')); ?></td>

        </tr>


        <tr>
            <td><?php echo $this->Form->input('Company.departament_id', array('id' => 'departamentos', 'label' => 'Departamentos', 'empty' => 'seleccione departamento', 'value' => $this->data['Departament']['id'])); ?>
                <?php
                echo $this->Ajax->observeField('departamentos', array(
                    'url' => array('controller' => 'Companies', 'action' => 'select'),
                    'frequency' => 0.2,
                    'update' => 'ciudades',
                        )
                );
                ?>
            </td>
            <td><div id="ciudades"><?php echo $this->Form->input('Company.city_id', array('empty'=>'', 'label' => 'Municipios', 'class' => 'required')); ?></div></td>
            <td><?php echo $this->Form->input('Company.vereda'); ?></td>
            <td><?php echo $this->Form->input('Company.corregimiento'); ?></td>
        </tr>
        <tr>
            <td></td>

        </tr>


    </tbody>
</table>



<?php echo $this->Form->end(array('label' => 'Guardar Empresa', 'class' => 'submit_button')); ?>
 



